package com.neuedu.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mybatisflex.annotation.*;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;

/**
 *  实体类。
 *
 * @author Administrator
 * @since 2024-04-23
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("employee")
public class Employee implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * ID主键
     */
    @Id(keyType = KeyType.Auto)
    private Integer id;

    /**
     * 真实姓名
     */
    private String realname;

    /**
     * 密码
     */
    @JsonIgnore
    private String password;

    /**
     * 所在科室ID
     */
    private Integer deptmentId;

    /**
     * 挂号级别ID
     */
    private Integer registLevelId;

    /**
     * 班排id
     */
    private Integer schedulingId;

    /**
     * 生效标记
     */
    private Integer delmark;

    @RelationManyToOne(selfField = "registLevelId", targetField = "id", selectColumns = "regist_name, regist_fee")
    private RegistLevel registLevel;

    @RelationOneToOne(selfField = "schedulingId", targetField = "id", selectColumns = "week_rule", extraCondition = "delmark = 1")
    Scheduling scheduling;
}
